package com.bosssoft.springcloud.service;

import com.bosssoft.springcloud.entities.CommenResult;
import com.bosssoft.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {


    /***
     * 查询订单列表
     * @return 订单列表
     */
    @RequestMapping("/payment/listAll")
    CommenResult getOrderList();

    /***
     *根据订单id查询订单
     * @param id 订单id
     * @return 订单
     */
    @GetMapping("/payment/get/{id}")
     CommenResult<Payment> getPayentById(@PathVariable("id") long id);

    /***
     * 添加订单
     * @param payment 订单
     * @return
     */
    @RequestMapping("/payment/create")
    CommenResult create(@RequestBody Payment payment);


    /***
     * 根据id删除订单
     * @param id
     */
    @RequestMapping  ("/payment/remove/{id}")
     CommenResult removeById(@PathVariable("id") long id);
}
